package com.app.couponsharelife.ui.main.nativelife.order.activity
import com.app.couponsharelife.R
import com.app.couponsharelife.base.BaseActivity
import com.app.couponsharelife.ui.dialog.RefundCauseDialog
import com.app.couponsharelife.ui.dialog.RefundSuccessDialog
import com.app.couponsharelife.ui.listener.OnClickListener
import com.app.couponsharelife.utils.AppUtils
import kotlinx.android.synthetic.main.activity_nl_order_details.*
import kotlinx.android.synthetic.main.base_title_white.*

/**
 *Created by xct on 2019/3/8
 *Description:本地生活订单详情页面
 */
class NativeLifeOrderDetailsActivity:BaseActivity() {
    private var dataList= arrayListOf<String>()
    private var refundSuccessDialog:RefundSuccessDialog?=null
    override val viewLayoutId: Int
        get() = R.layout.activity_nl_order_details

    override fun initViews() {
        AppUtils.initImmersionBar(this,true)
        basetitle_title.text="订单详情"
        basetitle_llclose.setOnClickListener { finish() }
        nlOrderDetails_tvTK.setOnClickListener { setRefundCauseDialog() }
        setList()
    }
    private fun setRefundCauseDialog(){
        RefundCauseDialog(this,R.style.DialogStyle,object : OnClickListener {
            override fun click(arg1: Int, arg2: Any) {
                setRefundSuccessDialog()
            }
        },dataList).show()
    }
    private fun setRefundSuccessDialog(){
        refundSuccessDialog=RefundSuccessDialog(this,R.style.DialogStyle,object : OnClickListener {
            override fun click(arg1: Int, arg2: Any) {
                if (refundSuccessDialog!=null&&refundSuccessDialog!!.isShowing){
                    refundSuccessDialog?.dismiss()
                }
            }
        })
        refundSuccessDialog!!.show()
    }
    private fun setList(){
        dataList.add("不想要")
        dataList.add("买错了")
        dataList.add("商家原因")
    }
    override fun onDestroy() {
        super.onDestroy()
        AppUtils.destroyImmersionBar(this)
    }
}